package com.ruix.app.model;

import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by hadexs on 2017/5/12.
 */

public class WXUserInfo implements Serializable{

    private String openid;
    private String nickname;
    private String province;
    private String city;
    private String country;
    private String headimgurl;
    private String privilege;
    private String unionid;
    private int sex;

    public WXUserInfo parse(JSONObject object){
        if (object != null){
            setOpenid(object.optString("openid",""));
            setNickname(object.optString("nickname",""));
            setProvince(object.optString("province",""));
            setCity(object.optString("city",""));
            setCountry(object.optString("country",""));
            setHeadimgurl(object.optString("headimgurl",""));
            setUnionid(object.optString("unionid",""));
            setSex(object.optInt("sex",0));
        }
        return this;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getHeadimgurl() {
        return headimgurl;
    }

    public void setHeadimgurl(String headimgurl) {
        this.headimgurl = headimgurl;
    }

    public String getPrivilege() {
        return privilege;
    }

    public void setPrivilege(String privilege) {
        this.privilege = privilege;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public String getUnionid() {
        return unionid;
    }

    public void setUnionid(String unionid) {
        this.unionid = unionid;
    }
}
